<?php echo $header; ?>

<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>

		<div class="col720 fl mgt20">

<?php if ($error_warning) { ?>
<div class="recover-warning">
<div class="notify warning">
<?php echo $error_warning; ?>
</div></div>
<?php } ?>

	<h2 class="mod-tile"><?php echo $heading_title; ?></h2>
    <div class="frmLogin-user mgt20">
        <p><?php echo $text_account_already; ?></p>

      


  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
    <h2 class="mod-tile"><?php echo $text_your_details; ?></h2>
	
    <div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			<?php if ($error_firstname) { ?><span><?php echo $error_firstname; ?></span>  <?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_firstname; ?><b class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="firstname" value="<?php echo $firstname; ?>" placeholder="<?php echo $firstname; ?>" type="text">
        </div>
		
		
		 <div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
		 <?php if ($error_lastname) { ?><span><?php echo $error_lastname; ?></span>  <?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_lastname; ?><b class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="lastname" value="<?php echo $lastname; ?>" placeholder="<?php echo $lastname; ?>" type="text">
        </div>
		
	<div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			 <?php if ($error_email) { ?><span><?php echo $error_email; ?></span> <?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_email; ?> <b class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="email" value="<?php echo $email; ?>" placeholder="<?php echo $email; ?>" type="text">
        </div>
		
		<div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			 <?php if ($error_telephone) { ?><span><?php echo $error_telephone; ?></span> <?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_telephone; ?> <b class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="telephone" value="<?php echo $telephone; ?>" placeholder="<?php echo $telephone; ?>" type="text">
        </div>
		
		
		<div class="item mgt20 clearfix">
           
        	<span class="lblText"><?php echo $entry_fax; ?> </span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="fax" value="<?php echo $fax; ?>" placeholder="<?php echo $fax; ?>" type="text">
        </div>
	
	
	
<h2 class="mod-tile"><?php echo $text_your_address; ?></h2>
    
	<div class="item mgt20 clearfix">
            
        	<span class="lblText"><?php echo $entry_company; ?></span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="company" value="<?php echo $company; ?>" placeholder="<?php echo $company; ?>" type="text">
        </div>
		
	<div class="item mgt20 clearfix">
            <table class="form">
      
		
        <tr style="display: <?php echo (count($customer_groups) > 1 ? 'table-row' : 'none'); ?>;">
          <td><?php echo $entry_customer_group; ?></td>
          <td><?php foreach ($customer_groups as $customer_group) { ?>
            <?php if ($customer_group['customer_group_id'] == $customer_group_id) { ?>
            <input type="radio" name="customer_group_id" value="<?php echo $customer_group['customer_group_id']; ?>" id="customer_group_id<?php echo $customer_group['customer_group_id']; ?>" checked="checked" />
            <label for="customer_group_id<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></label>
            <br />
            <?php } else { ?>
            <input type="radio" name="customer_group_id" value="<?php echo $customer_group['customer_group_id']; ?>" id="customer_group_id<?php echo $customer_group['customer_group_id']; ?>" />
            <label for="customer_group_id<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></label>
            <br />
            <?php } ?>
            <?php } ?></td>
        </tr>  
		 </table>
        </div>
		
	<div id="company-id-display" class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			  <?php if ($error_company_id) { ?><span ><?php echo $error_company_id; ?></span> <?php } ?>
			</p>
        	<span  class="lblText"><?php echo $entry_company_id; ?><b id="company-id-required" class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="company_id" value="<?php echo $company_id; ?>" placeholder="<?php echo $company_id; ?>" type="text">
        </div>
		
	
	<div id="tax-id-display" class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			 <?php if ($error_tax_id) { ?><span><?php echo $error_tax_id; ?></span> <?php } ?>
			</p>
        	<span  class="lblText"> <?php echo $entry_tax_id; ?> <b id="tax-id-required" class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="tax_id" value="<?php echo $tax_id; ?>"  placeholder="<?php echo $tax_id; ?>" type="text">
        </div>
		
		<div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			 <?php if ($error_address_1) { ?><span><?php echo $error_address_1; ?></span><?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_address_1; ?> <b class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px"  name="address_1" value="<?php echo $address_1; ?>" placeholder="<?php echo $address_1; ?>" type="text">
        </div>
		
		<div class="item mgt20 clearfix">
            
        	<span class="lblText"><?php echo $entry_address_2; ?> </span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="address_2" value="<?php echo $address_2; ?>"  placeholder="<?php echo $address_2; ?>" type="text">
        </div>
		
		<div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			  <?php if ($error_city) { ?><span><?php echo $error_city; ?></span> <?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_city; ?> <b class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px"  name="city" value="<?php echo $city; ?>"  placeholder="<?php echo $city; ?>" type="text">
        </div>
		
		<div id="postcode-required" class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			     <?php if ($error_postcode) { ?><span><?php echo $error_postcode; ?></span> <?php } ?>
			</p>
        	<span  class="lblText"><?php echo $entry_postcode; ?> <b class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px" name="postcode" value="<?php echo $postcode; ?>" placeholder="<?php echo $postcode; ?>" type="text">
        </div>
		
		<div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			   <?php if ($error_country) { ?><span><?php echo $error_country; ?></span>      <?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_country; ?><b class="clRed">*</b></span>
          	<select class="fl slDrop" style="width:123px;height:28px"name="country_id">
              <option value=""><?php echo $text_select; ?></option>
              <?php foreach ($countries as $country) { ?>
              <?php if ($country['country_id'] == $country_id) { ?>
              <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
        </div>
		
		<div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			  <?php if ($error_zone) { ?><span><?php echo $error_zone; ?></span>   <?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_zone; ?>  <b class="clRed">*</b></span>
   <select  class="fl slDrop" style="width:123px;height:28px" name="zone_id">
            </select>
			
        </div>
		
		

	
	
	
	
	<h2 class="mod-tile"><?php echo $text_your_password; ?></h2>
   

<div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			<?php if ($error_password) { ?><span><?php echo $error_password; ?></span><?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_password; ?>  <b class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px" type="password" name="password" value="<?php echo $password; ?>"  >
        </div>
	
<div class="item mgt20 clearfix">
            <p class="clearfix clPrice fs11 register-result" style="margin-left:195px">
			  <?php if ($error_confirm) { ?><span><?php echo $error_confirm; ?></span><?php } ?>
			</p>
        	<span class="lblText"><?php echo $entry_confirm; ?>  <b class="clRed">*</b></span>
            <input class="inputtxt fl" style="width:264px;height:28px" type="password" name="confirm" value="<?php echo $confirm; ?>" >
        </div>
		
		










 <h2 class="mod-tile"><?php echo $text_newsletter; ?></h2>
   

   <div class="content">
      <table class="form">
        <tr>
          <td><?php echo $entry_newsletter; ?></td>
          <td><?php if ($newsletter) { ?>
            <input type="radio" name="newsletter" value="1" checked="checked" />
            <?php echo $text_yes; ?>
            <input type="radio" name="newsletter" value="0" />
            <?php echo $text_no; ?>
            <?php } else { ?>
            <input type="radio" name="newsletter" value="1" />
            <?php echo $text_yes; ?>
            <input type="radio" name="newsletter" value="0" checked="checked" />
            <?php echo $text_no; ?>
            <?php } ?></td>
        </tr>
      </table>
    </div>
    
	
	
	
	
	
	
	
	
	<?php if ($text_agree) { ?>
    <div class="buttons">
      <div class="right"><?php echo $text_agree; ?>
        <?php if ($agree) { ?>
        <input type="checkbox" name="agree" value="1" checked="checked" />
        <?php } else { ?>
        <input type="checkbox" name="agree" value="1" />
        <?php } ?>
        <input type="submit" value="<?php echo $button_continue; ?>" class="small-button cancel register-click" />
      </div>
    </div>
    <?php } else { ?>
    <div class="buttons">
      <div class="right">
        <input type="submit" value="<?php echo $button_continue; ?>" class="small-button cancel register-click" />
      </div>
    </div>
    <?php } ?>
  </form>
    </div>
</div>
<!--end col720-->
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$('input[name=\'customer_group_id\']:checked').live('change', function() {
	var customer_group = [];
	
<?php foreach ($customer_groups as $customer_group) { ?>
	customer_group[<?php echo $customer_group['customer_group_id']; ?>] = [];
	customer_group[<?php echo $customer_group['customer_group_id']; ?>]['company_id_display'] = '<?php echo $customer_group['company_id_display']; ?>';
	customer_group[<?php echo $customer_group['customer_group_id']; ?>]['company_id_required'] = '<?php echo $customer_group['company_id_required']; ?>';
	customer_group[<?php echo $customer_group['customer_group_id']; ?>]['tax_id_display'] = '<?php echo $customer_group['tax_id_display']; ?>';
	customer_group[<?php echo $customer_group['customer_group_id']; ?>]['tax_id_required'] = '<?php echo $customer_group['tax_id_required']; ?>';
<?php } ?>	

	if (customer_group[this.value]) {
		if (customer_group[this.value]['company_id_display'] == '1') {
			$('#company-id-display').show();
		} else {
			$('#company-id-display').hide();
		}
		
		if (customer_group[this.value]['company_id_required'] == '1') {
			$('#company-id-required').show();
		} else {
			$('#company-id-required').hide();
		}
		
		if (customer_group[this.value]['tax_id_display'] == '1') {
			$('#tax-id-display').show();
		} else {
			$('#tax-id-display').hide();
		}
		
		if (customer_group[this.value]['tax_id_required'] == '1') {
			$('#tax-id-required').show();
		} else {
			$('#tax-id-required').hide();
		}	
	}
});

$('input[name=\'customer_group_id\']:checked').trigger('change');
//--></script> 
<script type="text/javascript"><!--
$('select[name=\'country_id\']').bind('change', function() {
	$.ajax({
		url: 'index.php?route=account/register/country&country_id=' + this.value,
		dataType: 'json',
		beforeSend: function() {
			$('select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
		},
		complete: function() {
			$('.wait').remove();
		},			
		success: function(json) {
			if (json['postcode_required'] == '1') {
				$('#postcode-required').show();
			} else {
				$('#postcode-required').hide();
			}
			
			html = '<option value=""><?php echo $text_select; ?></option>';
			
			if (json['zone'] != '') {
				for (i = 0; i < json['zone'].length; i++) {
        			html += '<option value="' + json['zone'][i]['zone_id'] + '"';
	    			
					if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
	      				html += ' selected="selected"';
	    			}
	
	    			html += '>' + json['zone'][i]['name'] + '</option>';
				}
			} else {
				html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
			}
			
			$('select[name=\'zone_id\']').html(html);
		},
		error: function(xhr, ajaxOptions, thrownError) {
			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
		}
	});
});

$('select[name=\'country_id\']').trigger('change');
//--></script> 
<script type="text/javascript"><!--
$('.colorbox').colorbox({
	width: 640,
	height: 480
});
//--></script> 
<?php echo $footer; ?>